Skip to content

Add unified _MACRO_MSG macro for all message types#4

Open
AstrandPallas wants to merge 1 commit intoAarCon:mainfrom
AstrandPallas:macro-msg
Open

Add unified _MACRO_MSG macro for all message types#4
AstrandPallas wants to merge 1 commit intoAarCon:mainfrom
AstrandPallas:macro-msg

Conversation

@AstrandPallas
Copy link

Summary

  • ev_macro.py: Added _MACRO_MSG to EvMacroType enum.
  • evAssembler.py: Added processUnifiedMacro() method to MacroAssembler class. Dispatches _MACRO_MSG('TYPE', 'bundle', 'label', 'text') calls by extracting the type string, mapping to the corresponding EvCmdType, and delegating to processTextMacro(). Supports TALKMSG, TALK_KEYWAIT, EASY_OBJ_MSG, EASY_BOARD_MSG, and ADD_CUSTUM_WIN_LABEL. Old per-type macros still work (backward compatible).

Test plan

  • Assemble a .ev file using _MACRO_MSG('TALKMSG', 'bundle', 'label', 'text') — verify identical output to _MACRO_TALKMSG('bundle', 'label', 'text')
  • Test each supported type string (TALKMSG, TALK_KEYWAIT, EASY_OBJ_MSG, EASY_BOARD_MSG, ADD_CUSTUM_WIN_LABEL)
  • Test invalid type string — verify clear error message
  • Verify existing _MACRO_TALKMSG etc. still work unchanged

Copy link
Owner

@AarCon AarCon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the branch you're working on from main and resubmit. There's a lot of changes in here that I just merged from the optimizations branch that I don't want to double touch.

Adds _MACRO_MSG to EvMacroType and processUnifiedMacro() to
MacroAssembler. Supports TALKMSG, TALK_KEYWAIT, EASY_OBJ_MSG,
EASY_BOARD_MSG, and ADD_CUSTUM_WIN_LABEL via a single macro:
_MACRO_MSG('TYPE', 'bundle', 'label', 'text')

Old macros (_MACRO_TALKMSG etc.) still work for backward compat.
Copy link
Owner

@AarCon AarCon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change needed and it should work just fine

self.fileName, msgTypeArg.line, msgTypeArg.column))

unifiedTypeMap = {
'TALKMSG': EvCmdType._TALKMSG,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change all of the keys for this to be the actual command name like "_TALKMSG".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants